package com.suse.common.config.response;

public class ApiException extends RuntimeException{

    private final Integer code;

    private final String message;

    public ApiException(String message) {
        super(message);
        this.code = 400;
        this.message = message;
    }

    public ApiException(Code code) {
        super(code.getMessage());
        this.code = code.getCode();
        message = code.getMessage();
    }

    public Integer getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }

}
